package cn.edu.javaweb.adminServlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.javaweb.javabean.Page;
import cn.edu.javaweb.service.AdminBlistService;
import cn.edu.javaweb.service.AdminePageService;
import cn.edu.javaweb.utils.DBUtil;

/**
 * Servlet implementation class BList
 */
@WebServlet("/Blist")
public class Bist extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	private AdminBlistService lists=new AdminBlistService();
	private AdminePageService temp=new AdminePageService();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.doPost(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List list=lists.getBlist();
		request.setAttribute("List",list);
		System.out.println(list);
//		System.out.println(list);
		String p = request.getParameter("page");
        Page page=temp.getPage(p,4,list);
        
        request.setAttribute("Page",page);
		request.getRequestDispatcher("volunteer/admin/blist.jsp").forward(request, response);
	}

}
